package com.geely.jdemo.restrict;

/**
 * 5.泛型中的局限性
 */
public class ExceptionRestrict {
    /**
     * 泛型类不能extends Exception/Throwable
     */
//    private class Problem<T> extends Exception{}

    /**
     * 不能捕获泛型类对象
     */
//    public <T extends Throwable> void doWorkFailed(T t) {
//        try {
//
//        } catch (T t) {
//
//        }
//    }
    public <T extends Throwable> void doWorkSuccess(T t) throws Throwable {
        try {
        } catch (Throwable e) {
            throw t;
        }
    }
}
